SearchResultPortlet = Class.extend({
	init: function()	{
		this.name = "SearchResultPortlet";
	},
	
	onReloadPage: function()	{
		this.run();
	},
	
	run: function()	{
		var obj = this;
		var key = this.getRequest().getParam('key');
		this.onAjax('product', 'search-products', {key: key}, 'POST', {
			'onSuccess': function(ret)	{
				obj.model = {};
				obj.model.result = ret;
				obj.getPortletPlaceholder().paintCanvas(obj.render());
			}
		});
	}	
}).implement(PortletInterface).implement(RenderInterface).implement(AjaxInterface).implement(ObserverInterface);